/* Solution by - Alec William Yeasting
 * Project Euler - problem 1:
 *
 *  If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9.
 *  The sum of these multiples is 23.
 *
 *  Find the sum of all the multiples of 3 or 5 below 1000.
 */
#include <iostream>
#include <time.h>

int sumOfMultiples(int bottom, int top);

int main()
{
    // Start execution time timer -------------------------------
        clock_t start, end;                                    //
        double time;                                           //
        start = clock();                                       //
    // ----------------------------------------------------------

    std::cout << "The sum of the multiples of 3 and 5 from 0 to 1000 is: " << sumOfMultiples(0,1000) << std::endl;

    // End execution time timer ---------------------------------
        end = clock();                                         //
        time = (double)(end - start)/CLOCKS_PER_SEC;           //
        std::cout << "Executed in: " << time << " seconds.\n"; //
    // ----------------------------------------------------------
    int hold;
    std::cin >> hold;
    return 0;
}

int sumOfMultiples(int bottom, int top){
    int sum = 0;
    for(int i = bottom; i < top; i++){ if(i%3==0 || i%5==0){sum+=i;}}
    return sum;
}
